% ad_trick.m 

function [Fzz]=ad_trick(f,g,Fz,z_vec,zp_vec,np_vec)

tic

nz=length(z_vec);
nn=length(np_vec);
nf=length(f);
ng=length(g);

Fzz=sym(zeros(nf,nz^2));

for h=1:nf
    Fzz(h,:) = transpose(vec(jacobian(Fz(h,:),z_vec)));
end





